-
Notifications
You must be signed in to change notification settings - Fork 694
Feature: Internal driver plugin system #3693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Internal driver plugin system #3693
Conversation
Please rebase e.g.,
|
c157971
to
bed5e1e
Compare
cmd/limactl/disk.go
Outdated
@@ -13,7 +13,7 @@ import ( | |||
"text/tabwriter" | |||
|
|||
contfs "github.com/containerd/continuity/fs" | |||
"github.com/docker/go-units" | |||
units "github.com/docker/go-units" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary to change this line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed this to fix the lint issue, but it wasn’t causing it anyway!
pkg/driver/vz/vz_driver_darwin.go
Outdated
info.DriverName = "vz" | ||
info.VsockPort = l.vSockPort | ||
info.VirtioPort = l.virtioPort | ||
if l.Instance != nil && l.Instance.Dir != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redundant check:
if l.Instance != nil && l.Instance.Dir != "" { | |
if l.Instance != nil { |
|
||
func (l *LimaWslDriver) Info() driver.Info { | ||
var info driver.Info | ||
if l.Instance != nil && l.Instance.Dir != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be:
if l.Instance != nil && l.Instance.Dir != "" { | |
if l.Instance != nil { |
a2dbce4
to
deaa857
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
The merge-base changed after approval.
Seems to need rebasing |
Signed-off-by: Ansuman Sahoo <[email protected]>
deaa857
to
363baf5
Compare
This pull request introduces a flexible, built-in plugin system for internal drivers. It leverages Go's blank import mechanism and build tags to allow for the conditional inclusion of drivers like QEMU and VZ directly into the
limactl
binary.Key Changes
init()
function and blank import (_
) pattern. Each internal driver now contains aregister.go
file that, when imported, automatically registers the driver with the central registry on program startup. This makes adding new built-in drivers a modular process.!external_qemu
,!external_vz
). This allows for creating customlimactl
builds with or without specific drivers compiled in. This functionality lays the groundwork for the next PR, which will update theMakefile
to support the use of these tags.driver.Driver
interface has been further broken down into smaller, more granular interfaces such asLifecycle
,SnapshotManager
, andGuestAgent
. This refactoring improves code modularity and makes the requirements for implementing a new driver clearer.pkg/driverutil/instance.go
has been introduced to centralise driver creation logic. The newCreateDriverInstance()
function looks up the appropriate driver in the registry and instantiates it.GSoC Project Context
This is the 3rd of 4 PRs in the initial GSoC project submission. It is dependent on the successful merge of the first two PRs #3691 and #3692 . After the prerequisite PRs are merged, this branch will be rebased to finalise the integration and prepare it for merging.
Related Issues